// js tap 选项卡
window.onload = function () {
    var olielem = document.getElementById('tapul');
    var lielem = olielem.getElementsByTagName('li');
    var divelem = document.getElementsByName('text');
    for(var i = 0; i < lielem.length; i++){
        lielem[i].index = i;
        lielem[i].onclick = function() {
            for(var i = 0; i < lielem.length; i++) {
                lielem[i].className = "";
            }
            lielem[this.index].className = 'active';

            for(var j = 0; j < divelem.length; j++) {
                divelem[j].className = "editboxhiden";
            }
            divelem[this.index].className = "editbox";
        }
    }
}
// 自适应高度
function reinitIframe(){
    var iframe = document.getElementById("resume_iframe");
    try{
        var bHeight = iframe.contentWindow.document.body.scrollHeight;
        var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
        var height = Math.max(bHeight, dHeight);
        iframe.height = height;
        console.log(height);
    }catch (ex){}
}
window.setInterval("reinitIframe()", 200);

// 样式选择事件

$("#sel_blueTable").click(function () {
    $("#resume_iframe").contents().find("#table_link").attr("href","../styles/bluetable.css");
});

$("#sel_Rimless").click(function () {
    $("#resume_iframe").contents().find("#table_link").attr("href","../styles/Rimless.css");
});